﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Phong_CTSV
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lbtnViewProfilePage.Visible = false;
            if (Session["userName"] != null)
            {
                lbtnUserName.Text = Session["userName"].ToString();
                lbtnViewProfilePage.Visible = true;
                lbtnSignOUT.Text = "Đăng Xuất";
            }
            else
            {
                lbtnSignOUT.Text = "Đăng Nhập";
            }
        }
        protected void lbtnViewProfilePage_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/ProfilePage.aspx");
        }
        protected void lbtnUserName_Click(object sender, EventArgs e)
        {
            if (lbtnUserName.Text == "Khách")
            {
                Response.Redirect("~/LoginPage.aspx");
            }
            else
            {
                Response.Redirect("~/ProfilePage.aspx");
            }
        }
        protected void lbtnSignOUT_Click(object sender, EventArgs e)
        {
            if (lbtnSignOUT.Text == "Đăng Xuất")
            {
                Session["userName"] = null;
                Session["addUni"] = null;
                Session["removeUser"] = null;
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                Response.Redirect("~/LoginPage.aspx");
            }
        }
    }
}
